package es.timmps.luchynews;

import android.net.Uri;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebView;
import android.widget.TextView;
import android.widget.Toast;

public class NoticiaActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_noticia);
        final Bundle extras = getIntent().getExtras();
        TextView titular = (TextView) findViewById(R.id.titular);
        WebView noticia = (WebView) findViewById(R.id.noticiaWeb);
        noticia.getSettings().setJavaScriptEnabled(true);
        String html =extras.getString("noticia");
        Toast.makeText(this, html, Toast.LENGTH_LONG).show();
        //noticia.loadData(extras.getString("noticia"), "text/html", "UTF-8");
        noticia.loadUrl(extras.getString("link"));
        titular.setText(extras.getString("titular"));
        titular.setOnClickListener(new OnClickListener(){

			public void onClick(View arg0) {
				
			}});
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_noticia, menu);
        return true;
    }
}
